home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Programming / cvs-1.11.1 / source / amiga.diffs next >
Encoding:
Text File  |  2001-01-01  |  25.8 KB  |  1,042 lines

  1. *** ORIG/diff/diff3.c    Tue Apr 24 18:14:52 2001
  2. --- diff/diff3.c     Mon Jul 23 23:45:05 2001
  3. ***************
  4. *** 1326,1332 ****
  5.     if (wstatus == 2)
  6.       diff3_fatal ("subsidiary diff failed");
  7.   
  8. !   if (-1 == (fd = open (diffout, O_RDONLY)))
  9.       diff3_fatal ("could not open temporary diff file");
  10.   
  11.     current_chunk_size = 8 * 1024;
  12. --- 1326,1332 ----
  13.     if (wstatus == 2)
  14.       diff3_fatal ("subsidiary diff failed");
  15.   
  16. !   if (-1 == (fd = open (diffout, O_RDONLY, 0))) /* Amiga */
  17.       diff3_fatal ("could not open temporary diff file");
  18.   
  19.     current_chunk_size = 8 * 1024;
  20. *** ORIG/diff/system.h    Thu Apr 19 19:45:28 2001
  21. --- diff/system.h     Mon Jul 23 23:45:05 2001
  22. ***************
  23. *** 270,275 ****
  24. --- 270,279 ----
  25.     }
  26.   #endif
  27.   
  28. + #ifdef AMIGA
  29. + #include "amiga.h"
  30. + #endif /* AMIGA */
  31.   /* these come from CVS's lib/system.h, but I wasn't sure how to include that
  32.    * properly or even if I really should
  33.    */
  34. *** ORIG/lib/getopt.c    Wed Feb 28 14:49:39 2001
  35. --- lib/getopt.c     Mon Jul 23 23:45:05 2001
  36. ***************
  37. *** 66,71 ****
  38. --- 66,75 ----
  39.   #include <stdlib.h>
  40.   #endif    /* GNU C library.  */
  41.   
  42. + #ifdef AMIGA
  43. + #include <stdlib.h>
  44. + #endif /* AMIGA */
  45.   /* This version of `getopt' appears to the caller like standard Unix `getopt'
  46.      but it behaves differently for the user, since it allows the user
  47.      to intersperse the options with the other arguments.
  48. *** ORIG/lib/getopt.h    Thu Apr 19 19:45:30 2001
  49. --- lib/getopt.h     Mon Jul 23 23:45:05 2001
  50. ***************
  51. *** 97,103 ****
  52. --- 97,107 ----
  53.      exactly why), and there is no particular need to prototype it.
  54.      We really shouldn't be trampling on the system's namespace at all by
  55.      declaring getopt() but that is a bigger issue.  */
  56. + #ifdef AMIGA
  57. + extern int getopt (int argc, char * const *argv, const char *optstring);
  58. + #else
  59.   extern int getopt ();
  60. + #endif
  61.   
  62.   extern int getopt_long (int argc, char *const *argv, const char *shortopts,
  63.                   const struct option *longopts, int *longind);
  64. *** ORIG/lib/regex.c    Thu Apr 19 19:45:30 2001
  65. --- lib/regex.c Mon Jul 23 23:52:46 2001
  66. ***************
  67. *** 145,151 ****
  68.   static char re_syntax_table[CHAR_SET_SIZE];
  69.   
  70.   static void
  71. ! init_syntax_once ()
  72.   {
  73.      register int c;
  74.      static int done = 0;
  75. --- 145,151 ----
  76.   static char re_syntax_table[CHAR_SET_SIZE];
  77.   
  78.   static void
  79. ! init_syntax_once (void)
  80.   {
  81.      register int c;
  82.      static int done = 0;
  83. ***************
  84. *** 358,364 ****
  85.   #define false 0
  86.   #define true 1
  87.   
  88. ! static int re_match_2_internal ();
  89.   
  90.   /* These are the command codes that appear in compiled regular
  91.      expressions.     Some opcodes are followed by argument bytes.  A
  92. --- 358,366 ----
  93.   #define false 0
  94.   #define true 1
  95.   
  96. ! static int re_match_2_internal(struct re_pattern_buffer *bufp, const char *string1,
  97. !                                int size1, const char *string2, int size2, int pos,
  98. !                                struct re_registers *regs, int stop); /* AMiGA */
  99.   
  100.   /* These are the command codes that appear in compiled regular
  101.      expressions.     Some opcodes are followed by argument bytes.  A
  102. ***************
  103. *** 540,548 ****
  104.   
  105.   #ifdef DEBUG
  106.   static void
  107. ! extract_number (dest, source)
  108. !     int *dest;
  109. !     unsigned char *source;
  110.   {
  111.     int temp = SIGN_EXTEND_CHAR (*(source + 1));
  112.     *dest = *source & 0377;
  113. --- 542,548 ----
  114.   
  115.   #ifdef DEBUG
  116.   static void
  117. ! extract_number (int *dest, unsigned char *source) /* AMiGA */
  118.   {
  119.     int temp = SIGN_EXTEND_CHAR (*(source + 1));
  120.     *dest = *source & 0377;
  121. ***************
  122. *** 567,575 ****
  123.   
  124.   #ifdef DEBUG
  125.   static void
  126. ! extract_number_and_incr (destination, source)
  127. !     int *destination;
  128. !     unsigned char **source;
  129.   {
  130.     extract_number (destination, *source);
  131.     *source += 2;
  132. --- 567,573 ----
  133.   
  134.   #ifdef DEBUG
  135.   static void
  136. ! extract_number_and_incr (int *destination, unsigned char **source) /* AMiGA */
  137.   {
  138.     extract_number (destination, *source);
  139.     *source += 2;
  140. ***************
  141. *** 1530,1540 ****
  142.   
  143.   /* Subroutine declarations and macros for regex_compile.  */
  144.   
  145. ! static void store_op1 (), store_op2 ();
  146. ! static void insert_op1 (), insert_op2 ();
  147. ! static boolean at_begline_loc_p (), at_endline_loc_p ();
  148. ! static boolean group_in_compile_stack ();
  149. ! static reg_errcode_t compile_range ();
  150.   
  151.   /* Fetch the next character in the uncompiled pattern---translating it
  152.      if necessary.  Also cast from a signed character in the constant
  153. --- 1528,1541 ----
  154.   
  155.   /* Subroutine declarations and macros for regex_compile.  */
  156.   
  157. ! /* AMiGA */
  158. ! static void store_op1(re_opcode_t op, unsigned char *loc, int arg);
  159. ! static void store_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2);
  160. ! static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end);
  161. ! static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end);
  162. ! static boolean at_begline_loc_p(const char *pattern, const char *p, reg_syntax_t syntax);
  163. ! static boolean at_endline_loc_p(const char *p, const char *pend, int syntax);
  164. ! static boolean group_in_compile_stack(struct compile_stack_type compile_stack, unsigned regnum);
  165.   
  166.   /* Fetch the next character in the uncompiled pattern---translating it
  167.      if necessary.  Also cast from a signed character in the constant
  168. ***************
  169. *** 1687,1693 ****
  170.   } compile_stack_elt_t;
  171.   
  172.   
  173. ! typedef struct
  174.   {
  175.     compile_stack_elt_t *stack;
  176.     unsigned size;
  177. --- 1688,1694 ----
  178.   } compile_stack_elt_t;
  179.   
  180.   
  181. ! typedef struct compile_stack_type
  182.   {
  183.     compile_stack_elt_t *stack;
  184.     unsigned size;
  185. ***************
  186. *** 1809,1816 ****
  187.      but don't make them smaller.     */
  188.   
  189.   static
  190. ! regex_grow_registers (num_regs)
  191. !      int num_regs;
  192.   {
  193.     if (num_regs > regs_allocated_size)
  194.       {
  195. --- 1810,1816 ----
  196.      but don't make them smaller.     */
  197.   
  198.   static
  199. ! regex_grow_registers(int num_regs) /* AMiGA */
  200.   {
  201.     if (num_regs > regs_allocated_size)
  202.       {
  203. ***************
  204. *** 1857,1867 ****
  205.     } while (0)
  206.   
  207.   static reg_errcode_t
  208. ! regex_compile (pattern, size, syntax, bufp)
  209. !      const char *pattern;
  210. !      int size;
  211. !      reg_syntax_t syntax;
  212. !      struct re_pattern_buffer *bufp;
  213.   {
  214.     /* We fetch characters from PATTERN here.  Even though PATTERN is
  215.        `char *' (i.e., signed), we declare these variables as unsigned, so
  216. --- 1857,1865 ----
  217.     } while (0)
  218.   
  219.   static reg_errcode_t
  220. ! regex_compile (const char *pattern, int size,
  221. !                reg_syntax_t syntax,
  222. !                struct re_pattern_buffer *bufp) /* AMiGA */
  223.   {
  224.     /* We fetch characters from PATTERN here.  Even though PATTERN is
  225.        `char *' (i.e., signed), we declare these variables as unsigned, so
  226. ***************
  227. *** 3107,3117 ****
  228.     const char *prev = p - 2;
  229.     boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
  230.   
  231. !   return
  232.          /* After a subexpression?  */
  233.          (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
  234.          /* After an alternative?     */
  235. !     || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
  236.   }
  237.   
  238.   
  239. --- 3105,3115 ----
  240.     const char *prev = p - 2;
  241.     boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
  242.   
  243. !   return (boolean)( /* AMiGA */
  244.          /* After a subexpression?  */
  245.          (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
  246.          /* After an alternative?     */
  247. !     || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)));
  248.   }
  249.   
  250.   
  251. ***************
  252. *** 3127,3139 ****
  253.     boolean next_backslash = *next == '\\';
  254.     const char *next_next = p + 1 < pend ? p + 1 : 0;
  255.   
  256. !   return
  257.          /* Before a subexpression?  */
  258.          (syntax & RE_NO_BK_PARENS ? *next == ')'
  259.       : next_backslash && next_next && *next_next == ')')
  260.          /* Before an alternative?  */
  261.       || (syntax & RE_NO_BK_VBAR ? *next == '|'
  262. !     : next_backslash && next_next && *next_next == '|');
  263.   }
  264.   
  265.   
  266. --- 3125,3137 ----
  267.     boolean next_backslash = *next == '\\';
  268.     const char *next_next = p + 1 < pend ? p + 1 : 0;
  269.   
  270. !   return (boolean)( /* AMiGA */
  271.          /* Before a subexpression?  */
  272.          (syntax & RE_NO_BK_PARENS ? *next == ')'
  273.       : next_backslash && next_next && *next_next == ')')
  274.          /* Before an alternative?  */
  275.       || (syntax & RE_NO_BK_VBAR ? *next == '|'
  276. !     : next_backslash && next_next && *next_next == '|'));
  277.   }
  278.   
  279.   
  280. ***************
  281. *** 3937,3946 ****
  282.   
  283.   /* Declarations and macros for re_match_2.  */
  284.   
  285. ! static int bcmp_translate ();
  286. ! static boolean alt_match_null_string_p (),
  287. !            common_op_match_null_string_p (),
  288. !            group_match_null_string_p ();
  289.   
  290.   /* This converts PTR, a pointer into one of the search strings `string1'
  291.      and `string2' into an offset from the beginning of that string.  */
  292. --- 3935,3945 ----
  293.   
  294.   /* Declarations and macros for re_match_2.  */
  295.   
  296. ! /* AMiGA */
  297. ! static int bcmp_translate(unsigned char *s1, unsigned char *s2, int len, RE_TRANSLATE_TYPE translate);
  298. ! static boolean alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info);
  299. ! static boolean common_op_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info);
  300. ! static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info);
  301.   
  302.   /* This converts PTR, a pointer into one of the search strings `string1'
  303.      and `string2' into an offset from the beginning of that string.  */
  304. *** ORIG/lib/regex.h    Thu Apr 19 19:45:30 2001
  305. --- lib/regex.h Mon Jul 23 23:45:05 2001
  306. ***************
  307. *** 485,493 ****
  308.   #ifdef _REGEX_RE_COMP
  309.   /* 4.2 bsd compatibility.  */
  310.   /* CVS: don't use prototypes: they may conflict with system headers.  */
  311.   extern char *re_comp _RE_ARGS (());
  312.   extern int re_exec _RE_ARGS (());
  313. ! #endif
  314.   
  315.   /* POSIX compatibility.  */
  316.   extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
  317. --- 485,499 ----
  318.   #ifdef _REGEX_RE_COMP
  319.   /* 4.2 bsd compatibility.  */
  320.   /* CVS: don't use prototypes: they may conflict with system headers.  */
  321. + #ifdef AMIGA
  322. + extern char *re_comp _RE_ARGS((const char *s));
  323. + extern int re_exec _RE_ARGS((const char *s));
  324. + #else
  325.   extern char *re_comp _RE_ARGS (());
  326.   extern int re_exec _RE_ARGS (());
  327. ! #endif /* AMIGA */
  328. ! #endif /* _REGEX_RE_COMP */
  329.   
  330.   /* POSIX compatibility.  */
  331.   extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
  332. *** ORIG/lib/sighandle.c    Thu Apr 19 19:45:30 2001
  333. --- lib/sighandle.c     Mon Jul 23 23:54:40 2001
  334. ***************
  335. *** 65,71 ****
  336.   
  337.   /* Define linked list of signal handlers structure */
  338.   struct SIG_hlist {
  339. !     RETSIGTYPE        (*handler)();
  340.       struct SIG_hlist    *next;
  341.   };
  342.   
  343. --- 65,71 ----
  344.   
  345.   /* Define linked list of signal handlers structure */
  346.   struct SIG_hlist {
  347. !    RETSIGTYPE     (*handler)(int sig); /* AMiGA */
  348.       struct SIG_hlist    *next;
  349.   };
  350.   
  351. *** ORIG/lib/system.h    Thu Apr 19 19:45:30 2001
  352. --- lib/system.h     Mon Jul 23 23:45:06 2001
  353. ***************
  354. *** 477,482 ****
  355. --- 477,490 ----
  356.   
  357.   #endif /* defined (__CYGWIN32__) || defined (WIN32) */
  358.   
  359. + #ifdef AMIGA
  360. + #include "amiga.h"
  361. + #define FOLD_FN_CHAR(c) amiga_fold_fn_char(c)
  362. + #define FILENAMES_CASE_INSENSITIVE 1
  363. + #define ISDIRSEP(c) ((c) == ':' || (c) == '/')
  364. + #endif /* AMIGA */
  365.   /* Some file systems are case-insensitive.  If FOLD_FN_CHAR is
  366.      #defined, it maps the character C onto its "canonical" form.  In a
  367.      case-insensitive system, it would map all alphanumeric characters
  368. *** ORIG/lib/xgetwd.c    Thu Apr 19 19:29:03 2001
  369. --- lib/xgetwd.c     Mon Jul 23 23:45:06 2001
  370. ***************
  371. *** 29,36 ****
  372. --- 29,41 ----
  373.   /* Amount by which to increase buffer size when allocating more space. */
  374.   #define PATH_INCR 32
  375.   
  376. + #ifdef AMIGA
  377. + char *xmalloc(size_t);
  378. + char *xrealloc(void *ptr, size_t bytes);
  379. + #else
  380.   char *xmalloc ();
  381.   char *xrealloc ();
  382. + #endif /* AMIGA */
  383.   
  384.   /* Return the current directory, newly allocated, arbitrarily long.
  385.      Return NULL and set errno on error. */
  386. *** ORIG/lib/xtime.h    Thu Feb 15 02:53:07 2001
  387. --- lib/xtime.h Mon Jul 23 23:45:06 2001
  388. ***************
  389. *** 27,32 ****
  390. --- 27,36 ----
  391.   #   endif /* !HAVE_SYS_TIME_H */
  392.   # endif /* !TIME_WITH_SYS_TIME */
  393.   
  394. + # ifdef timezone
  395. + #   undef timezone /* needed for sgi */
  396. + # endif /* timezone */
  397.   # ifdef HAVE_SYS_TIMEB_H
  398.   #   include <sys/timeb.h>
  399.   # else /* HAVE_SYS_TIMEB_H */
  400. ***************
  401. *** 45,54 ****
  402.       short        dstflag;    /* Field not used        */
  403.   };
  404.   # endif /* !HAVE_SYS_TIMEB_H */
  405. - # ifdef timezone
  406. - #   undef timezone /* needed for sgi */
  407. - # endif /* timezone */
  408.   
  409.   # if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
  410.   extern long timezone;
  411. --- 49,54 ----
  412. *** ORIG/src/client.c    Tue Apr 24 18:14:53 2001
  413. --- src/client.c     Mon Jul 23 23:57:05 2001
  414. ***************
  415. *** 3430,3436 ****
  416.   
  417.       memcpy (buf, data, nread);
  418.   
  419. !     return nread;
  420.   }
  421.   
  422.   /*
  423. --- 3430,3436 ----
  424.   
  425.       memcpy (buf, data, nread);
  426.   
  427. !     return (size_t)nread; /* AMiGA */
  428.   }
  429.   
  430.   /*
  431. ***************
  432. *** 3811,3817 ****
  433.   
  434.       if (resultp == NULL)
  435.       free (result);
  436. !     return input_index;
  437.   }
  438.   
  439.   /* Connect to a forked server process. */
  440. --- 3811,3817 ----
  441.   
  442.       if (resultp == NULL)
  443.       free (result);
  444. !     return (int)input_index; /* AMiGA */
  445.   }
  446.   
  447.   /* Connect to a forked server process. */
  448. ***************
  449. *** 4418,4426 ****
  450.          same.  */
  451.       if (tofd == fromfd)
  452.       {
  453. !         fromfd = dup (tofd);
  454. !         if (fromfd < 0)
  455. !         error (1, errno, "cannot dup net connection");
  456.       }
  457.   
  458.           /* These will use binary mode on systems which have it.  */
  459. --- 4418,4430 ----
  460.          same.  */
  461.       if (tofd == fromfd)
  462.       {
  463. ! #ifdef AMIGA
  464. !        fprintf(stderr,"HELP! dup() called!\n");
  465. ! #else
  466. !        fromfd = dup (tofd);
  467. !        if (fromfd < 0)
  468. !       error (1, errno, "cannot dup net connection");
  469. ! #endif /* AMIGA */
  470.       }
  471.   
  472.           /* These will use binary mode on systems which have it.  */
  473. ***************
  474. *** 5014,5020 ****
  475.       else
  476.       fd = CVS_OPEN (file, O_RDONLY | OPEN_BINARY);
  477.   #else
  478. !     fd = CVS_OPEN (file, O_RDONLY | (bin ? OPEN_BINARY : 0));
  479.   #endif
  480.   
  481.       if (fd < 0)
  482. --- 5018,5024 ----
  483.       else
  484.       fd = CVS_OPEN (file, O_RDONLY | OPEN_BINARY);
  485.   #else
  486. !     fd = CVS_OPEN (file, O_RDONLY | (bin ? OPEN_BINARY : 0), 0); /* AMiGA */
  487.   #endif
  488.   
  489.       if (fd < 0)
  490. *** ORIG/src/cvs.h    Tue Apr 24 18:14:53 2001
  491. --- src/cvs.h     Mon Jul 23 23:45:06 2001
  492. ***************
  493. *** 58,63 ****
  494. --- 58,67 ----
  495.   #include <strings.h>
  496.   #endif
  497.   
  498. + #ifdef AMIGA
  499. + #include "amiga.h"
  500. + #endif /* AMIGA */
  501.   #ifdef SERVER_SUPPORT
  502.   /* If the system doesn't provide strerror, it won't be declared in
  503.      string.h.  */
  504. *** ORIG/src/filesubr.c    Thu Apr 19 19:45:32 2001
  505. --- src/filesubr.c Tue Jul 24 00:00:14 2001
  506. ***************
  507. *** 63,69 ****
  508.       else
  509.       {
  510.       /* Not a link or a device... probably a regular file. */
  511. !     if ((fdin = open (from, O_RDONLY)) < 0)
  512.           error (1, errno, "cannot open %s for copying", from);
  513.       if (fstat (fdin, &sb) < 0)
  514.           error (1, errno, "cannot fstat %s", from);
  515. --- 63,69 ----
  516.       else
  517.       {
  518.       /* Not a link or a device... probably a regular file. */
  519. !    if ((fdin = open (from, O_RDONLY, 0)) < 0) /* AMiGA */
  520.           error (1, errno, "cannot open %s for copying", from);
  521.       if (fstat (fdin, &sb) < 0)
  522.           error (1, errno, "cannot fstat %s", from);
  523. ***************
  524. *** 110,115 ****
  525. --- 110,119 ----
  526.       t.actime = sb.st_atime;
  527.       t.modtime = sb.st_mtime;
  528.       (void) utime (to, &t);
  529. +     #ifdef AMIGA
  530. +     (void) chmod (to, sb.st_mode);
  531. +     #endif /* AMIGA */
  532.   }
  533.   
  534.   /* FIXME-krp: these functions would benefit from caching the char * &
  535. ***************
  536. *** 427,432 ****
  537. --- 431,437 ----
  538.    * removal of all of the files in the directory.  Return -1 on error
  539.    * (in which case errno is set).
  540.    */
  541. + #ifndef AMIGA
  542.   int
  543.   unlink_file_dir (f)
  544.       const char *f;
  545. ***************
  546. *** 467,472 ****
  547. --- 472,478 ----
  548.   
  549.       return CVS_UNLINK (f);
  550.   }
  551. + #endif /* AMIGA */
  552.   
  553.   /* Remove a directory and everything it contains.  Returns 0 for
  554.    * success, -1 for failure (in which case errno is set).
  555. ***************
  556. *** 580,586 ****
  557.       nchars -= nread;
  558.       } while (nchars != 0);
  559.   
  560. !     return bp - buf;
  561.   } 
  562.   
  563.       
  564. --- 586,592 ----
  565.       nchars -= nread;
  566.       } while (nchars != 0);
  567.   
  568. !     return (size_t)(bp - buf); /* AMiGA */
  569.   } 
  570.   
  571.       
  572. ***************
  573. *** 621,626 ****
  574. --- 627,633 ----
  575.       return result;
  576.       }
  577.   
  578. + #ifndef AMIGA
  579.       /* If FILE1 and FILE2 are devices, they are equal if their device
  580.          numbers match. */
  581.       if (S_ISBLK (sb1.st_mode) || S_ISCHR (sb1.st_mode))
  582. ***************
  583. *** 635,645 ****
  584.              file1, file2);
  585.   #endif
  586.       }
  587.   
  588. !     if ((fd1 = open (file1, O_RDONLY)) < 0)
  589. !     error (1, errno, "cannot open file %s for comparing", file1);
  590. !     if ((fd2 = open (file2, O_RDONLY)) < 0)
  591. !     error (1, errno, "cannot open file %s for comparing", file2);
  592.   
  593.       /* A generic file compare routine might compare st_dev & st_ino here 
  594.          to see if the two files being compared are actually the same file.
  595. --- 642,653 ----
  596.              file1, file2);
  597.   #endif
  598.       }
  599. + #endif /* AMIGA */
  600.   
  601. !     if ((fd1 = open (file1, O_RDONLY, 0 )) < 0) /* AMiGA */
  602. !    error (1, errno, "cannot open file %s for comparing", file1);
  603. !     if ((fd2 = open (file2, O_RDONLY, 0)) < 0) /* AMiGA */
  604. !    error (1, errno, "cannot open file %s for comparing", file2);
  605.   
  606.       /* A generic file compare routine might compare st_dev & st_ino here 
  607.          to see if the two files being compared are actually the same file.
  608. ***************
  609. *** 684,689 ****
  610. --- 692,698 ----
  611.       return (ret);
  612.   }
  613.   
  614. + #ifndef AMIGA
  615.   /* Generate a unique temporary filename.  Returns a pointer to a newly
  616.    * malloc'd string containing the name.  Returns successfully or not at
  617.    * all.
  618. ***************
  619. *** 707,712 ****
  620. --- 716,722 ----
  621.       error (0, errno, "Failed to close temporary file %s", fn);
  622.       return fn;
  623.   }
  624. + #endif /* AMIGA */
  625.   
  626.   /* Generate a unique temporary filename and return an open file stream
  627.    * to the truncated file by that name
  628. ***************
  629. *** 739,744 ****
  630. --- 749,755 ----
  631.    * NFS locking thing, but until I hear of more problems, I'm not going to
  632.    * bother.
  633.    */
  634. + #ifndef AMIGA
  635.   FILE *cvs_temp_file (filename)
  636.       char **filename;
  637.   {
  638. ***************
  639. *** 845,851 ****
  640. --- 856,864 ----
  641.       *filename = fn;
  642.       return fp;
  643.   }
  644. + #endif /* AMIGA */
  645.   
  646. + #ifndef AMIGA
  647.   /* Return non-zero iff FILENAME is absolute.
  648.      Trivial under Unix, but more complicated under other systems.  */
  649.   int
  650. ***************
  651. *** 854,859 ****
  652. --- 867,873 ----
  653.   {
  654.       return filename[0] == '/';
  655.   }
  656. + #endif /* AMIGA */
  657.   
  658.   /*
  659.    * Return a string (dynamically allocated) with the name of the file to which
  660. ***************
  661. *** 893,899 ****
  662.       return tfile;
  663.   }
  664.   
  665.   /* Return a pointer into PATH's last component.  */
  666.   char *
  667.   last_component (path)
  668. --- 907,913 ----
  669.       return tfile;
  670.   }
  671.   
  672. ! #ifndef AMIGA
  673.   /* Return a pointer into PATH's last component.  */
  674.   char *
  675.   last_component (path)
  676. ***************
  677. *** 906,911 ****
  678. --- 920,926 ----
  679.       else
  680.           return path;
  681.   }
  682. + #endif /* AMIGA */
  683.   
  684.   /* Return the home directory.  Returns a pointer to storage
  685.      managed by this function or its callees (currently getenv).
  686. ***************
  687. *** 955,960 ****
  688. --- 970,976 ----
  689.       return home;
  690.   }
  691.   
  692. + #ifndef AMIGA
  693.   /* See cvs.h for description.  On unix this does nothing, because the
  694.      shell expands the wildcards.  */
  695.   void
  696. ***************
  697. *** 970,975 ****
  698. --- 986,992 ----
  699.       for (i = 0; i < argc; ++i)
  700.       (*pargv)[i] = xstrdup (argv[i]);
  701.   }
  702. + #endif /* AMIGA */
  703.   
  704.   #ifdef SERVER_SUPPORT
  705.   /* Case-insensitive string compare.  I know that some systems
  706. *** ORIG/src/hash.c    Thu Apr 19 19:45:32 2001
  707. --- src/hash.c     Tue Jul 24 00:01:18 2001
  708. ***************
  709. *** 21,28 ****
  710.   
  711.   /* hash function */
  712.   static int
  713. ! hashp (key)
  714. !     const char *key;
  715.   {
  716.       unsigned int h = 0;
  717.       unsigned int g;
  718. --- 21,27 ----
  719.   
  720.   /* hash function */
  721.   static int
  722. ! hashp (const char *key) /* AMiGA */
  723.   {
  724.       unsigned int h = 0;
  725.       unsigned int g;
  726. ***************
  727. *** 38,44 ****
  728.           h = (h ^ (g >> 24)) ^ g;
  729.       }
  730.   
  731. !     return (h % HASHSIZE);
  732.   }
  733.   
  734.   /*
  735. --- 37,43 ----
  736.           h = (h ^ (g >> 24)) ^ g;
  737.       }
  738.   
  739. !     return (int)(h % HASHSIZE); /* AMiGA */
  740.   }
  741.   
  742.   /*
  743. ***************
  744. *** 184,190 ****
  745.   freenode_mem (p)
  746.       Node *p;
  747.   {
  748. !     if (p->delproc != (void (*) ()) NULL)
  749.       p->delproc (p);            /* call the specified delproc */
  750.       else
  751.       {
  752. --- 183,189 ----
  753.   freenode_mem (p)
  754.       Node *p;
  755.   {
  756. !     if (p->delproc != (void (*) (void *)) NULL) /* AMiGA */
  757.       p->delproc (p);            /* call the specified delproc */
  758.       else
  759.       {
  760. ***************
  761. *** 196,202 ****
  762.   
  763.       /* to be safe, re-initialize these */
  764.       p->key = p->data = (char *) NULL;
  765. !     p->delproc = (void (*) ()) NULL;
  766.   }
  767.   
  768.   /*
  769. --- 195,201 ----
  770.   
  771.       /* to be safe, re-initialize these */
  772.       p->key = p->data = (char *) NULL;
  773. !     p->delproc = (void (*) (void *)) NULL; /* AMiGA */
  774.   }
  775.   
  776.   /*
  777. *** ORIG/src/hash.h    Thu Apr 19 19:45:32 2001
  778. --- src/hash.h     Mon Jul 23 23:45:07 2001
  779. ***************
  780. *** 11,16 ****
  781. --- 11,20 ----
  782.    */
  783.   #define HASHSIZE    151
  784.   
  785. + #ifdef AMIGA
  786. + #undef NT_UNKNOWN
  787. + #endif /* AMIGA */
  788.   /*
  789.    * Types of nodes
  790.    */
  791. ***************
  792. *** 31,37 ****
  793.       struct node *hashprev;
  794.       char *key;
  795.       char *data;
  796. !     void (*delproc) ();
  797.   };
  798.   typedef struct node Node;
  799.   
  800. --- 35,41 ----
  801.       struct node *hashprev;
  802.       char *key;
  803.       char *data;
  804. !     void (*delproc) (void *); /* AMiGA */
  805.   };
  806.   typedef struct node Node;
  807.   
  808. *** ORIG/src/history.c    Thu Apr 19 19:45:32 2001
  809. --- src/history.c     Tue Jul 24 00:02:21 2001
  810. ***************
  811. *** 1061,1067 ****
  812.       int fd;
  813.       struct stat st_buf;
  814.   
  815. !     if ((fd = CVS_OPEN (fname, O_RDONLY | OPEN_BINARY)) < 0)
  816.       error (1, errno, "cannot open history file: %s", fname);
  817.   
  818.       if (fstat (fd, &st_buf) < 0)
  819. --- 1061,1067 ----
  820.       int fd;
  821.       struct stat st_buf;
  822.   
  823. !     if ((fd = CVS_OPEN (fname, O_RDONLY | OPEN_BINARY, 0)) < 0) /* AMiGA */
  824.       error (1, errno, "cannot open history file: %s", fname);
  825.   
  826.       if (fstat (fd, &st_buf) < 0)
  827. *** ORIG/src/main.c    Fri Apr 27 19:57:23 2001
  828. --- src/main.c     Tue Jul 24 00:03:22 2001
  829. ***************
  830. *** 18,24 ****
  831. --- 18,26 ----
  832.   #ifdef HAVE_WINSOCK_H
  833.   #include <winsock.h>
  834.   #else
  835. + #ifndef AMIGA
  836.   extern int gethostname ();
  837. + #endif /* AMIGA */
  838.   #endif
  839.   
  840.   char *program_name;
  841. ***************
  842. *** 99,105 ****
  843.       char *nick1;
  844.       char *nick2;
  845.       
  846. !     int (*func) ();        /* Function takes (argc, argv) arguments. */
  847.       unsigned long attr;        /* Attributes. */
  848.   } cmds[] =
  849.   
  850. --- 101,107 ----
  851.       char *nick1;
  852.       char *nick2;
  853.       
  854. !     int (*func) (int argc, char ** argv);     /* Function takes (argc, argv) arguments. */ /* AMiGA */
  855.       unsigned long attr;        /* Attributes. */
  856.   } cmds[] =
  857.   
  858. *** ORIG/src/run.c    Thu Apr 19 19:45:33 2001
  859. --- src/run.c     Tue Jul 24 00:04:15 2001
  860. ***************
  861. *** 98,103 ****
  862. --- 98,182 ----
  863.       const char *sterr;
  864.       int flags;
  865.   {
  866. + #ifdef AMIGA
  867. +     int len,total_len,quotes,escape,result,i,j;
  868. +     char * s;
  869. +     char * arg;
  870. +     char * command;
  871. +     if (noexec && (flags & RUN_REALLY) == 0)
  872. +    return (0);
  873. +     total_len = 0;
  874. +     for (i = 0; i < run_argc; i++)
  875. +     {
  876. +         arg = run_argv[i];
  877. +         len = strlen(arg);
  878. +         quotes = 0;
  879. +         for(j = 0 ; j < len ; j++)
  880. +         {
  881. +            if(arg[j] == ' ' && quotes == 0)
  882. +                quotes = 2;
  883. +            else if (arg[j] == '\"')
  884. +                total_len++;
  885. +         }
  886. +         total_len += len + quotes + 1;
  887. +     }
  888. +     command = malloc(total_len+1);
  889. +     if(command == NULL)
  890. +     {
  891. +         errno = ENOMEM;
  892. +         return(-1);
  893. +     }
  894. +     s = command;
  895. +     for (i = 0; i < run_argc; i++)
  896. +     {
  897. +         arg = run_argv[i];
  898. +         len = strlen(arg);
  899. +         quotes = escape = 0;
  900. +         for(j = 0 ; j < len ; j++)
  901. +         {
  902. +            if(arg[j] == ' ')
  903. +                quotes = 1;
  904. +            else if (arg[j] == '\"')
  905. +                escape = 1;
  906. +            if(quotes == 1 && escape == 1)
  907. +                break;
  908. +         }
  909. +         if(quotes)
  910. +             (*s++) = '\"';
  911. +         for(j = 0 ; j < len ; j++)
  912. +         {
  913. +             if(arg[j] == '\"')
  914. +                 (*s++) = '*';
  915. +             (*s++) = arg[j];
  916. +         }
  917. +         if(quotes)
  918. +             (*s++) = '\"';
  919. +         if(i < run_argc-1)
  920. +           (*s++) = ' ';
  921. +     }
  922. +     (*s) = '\0';
  923. +     result = system(command);
  924. +     free(command);
  925. +     return(0);
  926. + #else
  927.       int shin, shout, sherr;
  928.       int mode_out, mode_err;
  929.       int status;
  930. ***************
  931. *** 345,350 ****
  932. --- 424,431 ----
  933.       if (rerrno)
  934.       errno = rerrno;
  935.       return (rc);
  936. + #endif /* AMIGA */
  937.   }
  938.   
  939.   void
  940. ***************
  941. *** 402,407 ****
  942. --- 483,495 ----
  943.        int *tofdp;
  944.        int *fromfdp;
  945.   {
  946. + #ifdef AMIGA
  947. +     int pid;
  948. +     pid = amiga_piped_child(command,tofdp,fromfdp);
  949. +     return(pid);
  950. + #else
  951.       int pid;
  952.       int to_child_pipe[2];
  953.       int from_child_pipe[2];
  954. ***************
  955. *** 447,452 ****
  956. --- 535,541 ----
  957.       *tofdp = to_child_pipe[1];
  958.       *fromfdp = from_child_pipe[0];
  959.       return pid;
  960. + #endif /* AMIGA */
  961.   }
  962.   
  963.   
  964. ***************
  965. *** 454,461 ****
  966.   close_on_exec (fd)
  967.        int fd;
  968.   {
  969.   #ifdef F_SETFD
  970.       if (fcntl (fd, F_SETFD, 1))
  971. !     error (1, errno, "can't set close-on-exec flag on %d", fd);
  972.   #endif
  973.   }
  974. --- 543,552 ----
  975.   close_on_exec (fd)
  976.        int fd;
  977.   {
  978. + #ifndef AMIGA
  979.   #ifdef F_SETFD
  980.       if (fcntl (fd, F_SETFD, 1))
  981. !    error (1, errno, "can't set close-on-exec flag on %d", fd);
  982.   #endif
  983. + #endif /* AMIGA */
  984.   }
  985. *** ORIG/src/subr.c    Thu Apr 19 19:34:04 2001
  986. --- src/subr.c     Tue Jul 24 00:05:13 2001
  987. ***************
  988. *** 744,749 ****
  989. --- 744,750 ----
  990.       newname = xreadlink (*filename);
  991.   #else
  992.       error (1, 0, "internal error: islink doesn't like readlink");
  993. +    newname = ""; /* AMiGA */
  994.   #endif
  995.       
  996.       if (isabsolute (newname))
  997. *** ORIG/zlib/zconf.h    Thu Apr 19 19:34:06 2001
  998. --- zlib/zconf.h     Mon Jul 23 23:45:07 2001
  999. ***************
  1000. *** 276,279 ****
  1001. --- 276,283 ----
  1002.   #   pragma map(inflate_trees_free,"INTRFR")
  1003.   #endif
  1004.   
  1005. + #ifdef AMIGA
  1006. + #include "amiga.h"
  1007. + #endif /* AMIGA */
  1008.   #endif /* _ZCONF_H */
  1009.